package com.jiyinit.web.core.mobile.service;

import java.util.List;

import javax.annotation.Resource;

import com.jiyinit.web.core.mobile.dto.ExchangeRequest;
import org.springframework.stereotype.Service;

import com.jiyinit.core.framework.base.paging.PagingResult;
import com.jiyinit.web.core.mobile.dao.TabCoreExchangeCommentDao;
import com.jiyinit.web.core.mobile.dto.ExchangeCommentRequest;
import com.jiyinit.web.core.mobile.entity.TabCoreExchangeCommentEntity;

@Service("core.exchangeCommentServiceImpl")
public class ExchangeCommentServiceImpl {
	
	@Resource(name = "core.tabCoreExchangeCommentDao")
	private TabCoreExchangeCommentDao tabCoreExchangeCommentDao;
	
	
	/**
     * 多条件分页查询
     * @param request
     * @return
     */
	public PagingResult<TabCoreExchangeCommentEntity> findForPage(ExchangeCommentRequest request){
        return tabCoreExchangeCommentDao.findForPage(request);
    }
	
	/**
	 * id查询
     * @param id
     * @return
     */
	public TabCoreExchangeCommentEntity findOne(Integer id){
		return tabCoreExchangeCommentDao.findOne(id);
	}
	
	/**
	 * 添加
     * @param entity
     * @return
     */
	public int add(TabCoreExchangeCommentEntity entity){
		return tabCoreExchangeCommentDao.add(entity);
	}
	
	/**
	 * 修改
     * @param entity
     * @return
     */
	public int update(TabCoreExchangeCommentEntity entity){
		return tabCoreExchangeCommentDao.update(entity);
	}
	
	/**
	 * 删除
     * @param id
     * @return
     */
	public int delete(Integer id){
		return tabCoreExchangeCommentDao.delete(id);
	}

	/**
	 * 查询点赞
	 * @param entity
	 * @return
	 */
	public int find(TabCoreExchangeCommentEntity entity) {
		return tabCoreExchangeCommentDao.find(entity);
	}

	/**
	 * 帖子详情
	 * @param request
	 * @return
	 */
	public PagingResult<TabCoreExchangeCommentEntity> historyList(ExchangeCommentRequest request) {
		return tabCoreExchangeCommentDao.historyList(request)	;
	}

	/**
	 * 删除点赞
	 * @param entity
	 * @return
	 */
	public int deleteByUserId(TabCoreExchangeCommentEntity entity) {
		return tabCoreExchangeCommentDao.deleteByUserId(entity);
	}
}
